<template>
	<view class="guess-section">
		<view 
			class="guess-item"
			@click="navToDetailPage(item)"
		>
			<view class="image-wrapper">
				<image :src="item.primary_img" mode="aspectFill" lazy-load></image>
			</view>
			<text class="title clamp">{{item.product_name}}</text>
			<text class="price">￥{{item.sale_price}}</text>
		</view>
		</view>
</template>

<script>
	export default {
		data(){
			return{
				
			}
		},
		props:{
			item:{
				type:Object,
				default:null
			}
		},
		methods:{
			navToDetailPage(item){
				this.$emit('navToDetailPage',item)
			}
		}
	}
</script>

<style lang="scss">
	.guess-section{
		padding: 0 30upx;
		background: #00ff00;
		.guess-item{
			display:flex;
			flex-direction: column;
			width: 48%;
			padding-bottom: 40upx;
			background: #55ffff;
			&:nth-child(2n+1){
				margin-right: 4%;
			}
		}
		.image-wrapper{
			width: 100%;
			height: 330upx;
			border-radius: 3px;
			overflow: hidden;
			image{
				width: 100%;
				height: 100%;
				opacity: 1;
			}
		}
		.title{
			font-size: $font-lg;
			color: $font-color-dark;
			line-height: 80upx;
		}
		.price{
			font-size: $font-lg;
			color: $uni-color-primary;
			line-height: 1;
		}
	}
</style>
